package xml.uidElements.entry;


public class DataItemSet extends AbstractDataItem{

	private DataItem dataItem;
	private int cardinalityMin;
	private int cardinalityMax;
	private boolean optional;
	
	public DataItemSet(String name) {
		dataItem = new DataItem(name);
	}

	public DataItemSet(String name, String domain) {
		dataItem = new DataItem(name, domain);
	}

	public void setCardinality(int cardinalityMin, int cardinalityMax) {
		
		this.setCardinalityMin(cardinalityMin);
		this.setCardinalityMax(cardinalityMax);
	}

	private void setCardinalityMin(int cardinalityMin) {
		this.cardinalityMin = cardinalityMin;
	}

	public int getCardinalityMin() {
		return cardinalityMin;
	}

	private void setCardinalityMax(int cardinalityMax) {
		this.cardinalityMax = cardinalityMax;
	}

	public int getCardinalityMax() {
		return cardinalityMax;
	}

	@Override
	public String getName() {
		return dataItem.getName();
	}

	public void setOptional(boolean optional) {
		this.optional = optional;
	}

	public boolean isOptional() {
		return optional;
	}

	public String getDomain() {
		return dataItem.getDomain();
	}
	
	public void setDomain(String domain) {
		this.dataItem.setDomain(domain);
	}
	
}
